package com.powerbank.devicecenter.mqtt;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * MQTT配置属性
 */
@Data
@Component
@ConfigurationProperties(prefix = "mqtt")
public class MqttProperties {

    private Broker broker = new Broker();
    private Topics topics = new Topics();

    @Data
    public static class Broker {
        private String url;
        private String username;
        private String password;
        private String clientId;
        private Integer keepAlive;
        private Boolean cleanSession;
    }

    @Data
    public static class Topics {
        private String deviceStatus;
        private String deviceCommand;
        private String deviceHeartbeat;
    }
}